﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="FrontDesk.aspx.cs" Inherits="FE_FrontDesk" %>
<%@ Register Src="~/UserControl/HotelDiagram.ascx" TagName="HotelDiagram" TagPrefix="uc" %>
<%@ Register Src="~/UserControl/HotelFiltering.ascx" TagName="HotelFilter" TagPrefix="uc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="LeftContent" runat="Server">
    <uc:HotelFilter ID="uxFiltering" runat="server" OnHotelFiltered="uxFiltering_HotelFiltered" />
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="PageContent" runat="Server">      
    <uc:HotelDiagram ID="uxDiagrams" runat="server"  SelectionMode="ContextMenu"  />
   
    <gr:HotelContextMenu ID="uxRoomEmpty" runat="server" OnClientItemClicking="doMenuClicking" OnItemClick="DoContextMenuClick" XMLKey="RoomAction_EmptyRoom">  
    </gr:HotelContextMenu>
    <gr:HotelContextMenu ID="uxRoomReversed" runat="server" OnClientItemClicking="doMenuClicking" OnItemClick="DoContextMenuClick" XMLKey="RoomAction_ReversedRoom">  
    </gr:HotelContextMenu>
    <gr:HotelContextMenu ID="uxRoomCheckedIn" runat="server" OnClientItemClicking="doMenuClicking" OnItemClick="DoContextMenuClick" XMLKey="RoomAction_CheckedInRoom">  
    </gr:HotelContextMenu>
     <gr:HotelContextMenu ID="uxRoomDirty" runat="server" OnClientItemClicking="doMenuClicking" OnItemClick="DoContextMenuClick" XMLKey="RoomAction_DirtyRoom">  
    </gr:HotelContextMenu>
    <gr:HotelContextMenu ID="uxRoomMaintenance" runat="server" OnClientItemClicking="doMenuClicking" OnItemClick="DoContextMenuClick" XMLKey="RoomAction_MaintenanceRoom">  
    </gr:HotelContextMenu>
    <gr:Button runat="server" ID="uxReload" style=" display:none;" OnClick="uxReload_Click" />
    <gr:GuruCodeBlock runat="server">
        <script type="text/javascript">
            function doMenuClicking(sender, args) {               
                var menuItemValue = args.get_item().get_value();
                switch(menuItemValue){
                    case "CheckIn":
                        args.set_cancel(true);  
                        sender.hide();
                        OpenPopupModal(1, 'CheckInModal.aspx?' + sender.secParams);  
                        break;
                    case "Booking":
                        args.set_cancel(true);  
                        sender.hide();
                        OpenPopupModal(1, 'CheckInModal.aspx?' + sender.secParams+"&mode=2");  
                        break;                  
                    case "CheckOut":
                        args.set_cancel(true);  
                        sender.hide();
                        OpenPopupModal(1, 'CheckOutModal.aspx?' + sender.secParams);  
                        break;
                    case "ChangeRooom":
                        args.set_cancel(true);  
                        sender.hide();
                        OpenPopupModal(1, 'ChangeRoomModal.aspx?' + sender.secParams);                       
                        break;
                    case "Services":
                        args.set_cancel(true);  
                        sender.hide();
                        OpenPopupModal(1, 'ServicesModal.aspx?' + sender.secParams);  
                        break;
                    case "ViewCustomerInfor":
                        args.set_cancel(true);  
                        sender.hide();
                        OpenPopupModal(1, 'CustomerDetails.aspx?' + sender.secParams);  
                        break;
                    case "ViewRoomInfor":
                        args.set_cancel(true);  
                        sender.hide();
                        OpenPopupModal(1, '<%=ResolveUrl("~/")%>HK/RoomInfoModal.aspx?' + sender.secParams);  
                        break;
                }
                return false;
            }
            function getContextMenu(roomStatus) {
                var contextMenuID = "";
                switch(roomStatus)
                {
                    case "<%=(int)HSMEnums.RoomStatus.Empty %>":
                        contextMenuID = '<%=uxRoomEmpty.ClientID %>';
                        break;
                    case "<%=(int)HSMEnums.RoomStatus.SingleCheckedIn%>":
                        contextMenuID = '<%=uxRoomCheckedIn.ClientID %>';
                        break;
                    case "<%=(int)HSMEnums.RoomStatus.MultiCheckedIn%>":
                        contextMenuID = '<%=uxRoomCheckedIn.ClientID %>';
                        break;
                    case "<%=(int)HSMEnums.RoomStatus.Dirty%>":
                        contextMenuID = '<%=uxRoomDirty.ClientID %>';
                        break;
                    case "<%=(int)HSMEnums.RoomStatus.Maintenance%>":
                        contextMenuID = '<%=uxRoomMaintenance.ClientID %>';
                        break;
                    case "<%=(int)HSMEnums.RoomStatus.Reserved%>":
                        contextMenuID = '<%=uxRoomReversed.ClientID %>';
                        break;
                }
                return $find(contextMenuID);
            }
            function ReloadPage(){
                document.getElementById("<%=uxReload.ClientID%>").click();
            }
        </script>
    </gr:GuruCodeBlock>
</asp:Content>
